package com.why.blog.dao.mapper;

import com.why.blog.entity.HaloPost;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.why.blog.entity.VO.PostVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author TriggerWu
 * @since 2019-04-28
 */
@Repository
@Mapper
public interface HaloPostMapper extends BaseMapper<HaloPost> {

    //前台返回vo
    PostVO showPostVo(@Param("postId") String postId);

    //展示前台博客
    List<PostVO> RecentIndex(@Param("categoryId") Integer categoryId, @Param("page") Integer page, @Param("pageSize") Integer pageSize);

    //显示数量
    Integer queryindexCount(@Param("categoryId") Integer categoryId);

    //分类下的post
    List<PostVO> catePost(@Param("categoryId") Integer categoryId);

    //显示同类tag总数
    Integer querytagsCount(@Param("tagId") Integer tagId);

    //根据tag的id查询同类tag
    List<PostVO> selectTags(@Param("tagId") Integer tagId, @Param("page") Integer page, @Param("pageSize") Integer pageSize);
}
